package com.ust.app.training;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import com.ust.app.movie.entity.User;


public class HibernateAnnotation {

	public static void main(String...args){
		Configuration config = new Configuration();
		config.configure("hibernate.cfg.xml");
		SessionFactory factory = config.buildSessionFactory();
		
		Session session = factory.getCurrentSession();
		session.beginTransaction();
		
		User user = new User();
		user.setPassword("unknown");
		user.setUsername("unknown");
		
		//session.merge();
		//session.delete();
		session.save(user);
		session.getTransaction().commit();
		
		
	}
}
